﻿using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;

namespace ImageHandler.Models
{
    public class ResultModel : ObservableObject
    {
        private string _result;
        public string Result
        {
            get => _result;
            set => SetProperty(ref _result, value);
        }

        //原始图像
        private BitmapImage _originalImage;
        public BitmapImage OriginalImage
        {
            get => _originalImage;
            set => SetProperty(ref _originalImage, value);
        }

        //单个处理结果
        private ReslutInfoModel singleResult;
        public ReslutInfoModel SingleResult
        {
            get => singleResult;
            set => SetProperty(ref singleResult, value);
        }

        //多步骤的处理结果的当前选中项
        private ReslutInfoModel _selectedResultInfo;
        public ReslutInfoModel SelectedResultInfo
        {
            get => _selectedResultInfo;
            set => SetProperty(ref _selectedResultInfo, value);
        }

        //多步骤的处理结果
        public ObservableCollection<ReslutInfoModel> ReslutInfos { get; set; } = new();
    }

    public class ReslutInfoModel : ObservableObject
    {
        private string _title;
        public string Title
        {
            get => _title;
            set => SetProperty(ref _title, value);
        }

        private BitmapImage _image;
        public BitmapImage Image
        {
            get => _image;
            set => SetProperty(ref _image, value);
        }

        public override string ToString()
        {
            return Title.ToString();
        }
    }
}
